﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="Order_Info.aspx.cs" Inherits="TimKen.Web.Admin.Order.Order_Info"
    EnableEventValidation="false" ValidateRequest="false" %>

<%@ Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentLinkAction" runat="server">
    <span class="action-span"><a href="Order_List.aspx">
        <%=GetLangString("Orders")%>
    </a></span>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentTitle" runat="server">
    <%=GetLangString("OrderInfo")%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentMain" runat="server">
    <script type="text/javascript">
        window.onload = function () {


        }
        function Rek() {
            window.location.href = 'OrderPrint.aspx?OrderID=' + document.getElementById("OrID").value;
        }
        function method1(tableid) {
            var curTbl = document.getElementById(tableid);
            var oXL = new ActiveXObject("Excel.Application");
            var oWB = oXL.Workbooks.Add();
            var oSheet = oWB.ActiveSheet;
            var sel = document.body.createTextRange();
            sel.moveToElementText(curTbl);
            sel.select();
            sel.execCommand("Copy");
            oSheet.Paste();
            oXL.Visible = true;
        }

    </script>
    <div class="list-div" style="margin-bottom: 5px">
        <table width="100%" cellpadding="3" cellspacing="1">
            <tr>
                <th colspan="4">
                    <%=GetLangString("OrderInfo")%>
                </th>
            </tr>
            <tr>
                <td width="15%">
                    <div align="right">
                        <strong>
                            <%=GetLangString("OrderNo")%>：</strong></div>
                </td>
                <td width="34%">
                    <label id="orderNo">
                        <%=Order.OrderNo%></label>
                    &nbsp;
                    <input type="hidden" value='<%=Order.OrderID%>' id="OrID" />
                </td>
                <td width="15%">
                    <div align="right">
                        <strong>
                            <%=GetLangString("OrderStatus")%>：</strong></div>
                </td>
                <td>
                    <%=OrderManager.GetOrderStatusName(Order.OrderStatus, LanguageID)%>&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("CardName")%>：</strong></div>
                </td>
                <td>
                    <ux:LanguagePic ID="LanguagePic1" runat="server" languageName="Chinese" />
                    <%=Order.CustomerName%>&nbsp;
                    <ux:LanguagePic ID="LanguagePic2" runat="server" languageName="English" />
                    <%=Order.CustomerForeignName%>&nbsp; [ <a href="../Customer/Customer_Info.aspx?CustomerID=<%=Order.CustomerID%>">
                        <%=GetLangString("ShowCustomInfo")%></a> ]
                </td>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("OrderDate")%>：</strong></div>
                </td>
                <td>
                    <%=Order.CreateDate.ToShortDateString()%>&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("ShippingType")%>：</strong></div>
                </td>
                <td>
                    <asp:DropDownList ID="ddlTransType" runat="server" DataTextField="TransTypeName"
                        DataValueField="TransTypeID">
                    </asp:DropDownList>
                </td>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("ExpectDate")%>：</strong></div>
                </td>
                <td>
                    <%=Order.ExpectDate.Value.ToShortDateString()%>
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("Freight")%>：</strong></div>
                </td>
                <td>
                    <asp:TextBox ID="txtFreight" runat="server"></asp:TextBox>
                </td>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("PlanDeliveryDate")%>：</strong></div>
                </td>
                <td>
                    <asp:TextBox ID="txtPlanDate" runat="server" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("CloseDate")%>：</strong></div>
                </td>
                <td>
                    <%=Order.CloseDate%>&nbsp;
                </td>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("DeliveryDate")%>：</strong></div>
                </td>
                <td>
                    <%=Order.DeliveryDate.HasValue ? Order.DeliveryDate.Value.ToShortDateString() : GetLangString("NoDelivery")%>&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("ApproveTime")%>：</strong></div>
                </td>
                <td>
                    <%=Order.ApproveTime.HasValue?Order.ApproveTime.Value.ToShortDateString():""%>&nbsp;
                </td>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("ContractStatus")%>： </strong>
                    </div>
                </td>
                <td>
                    <%=Order.ContractStatus.HasValue ? (Order.ContractStatus.Value == 0 ? GetLangString("ForConfirm") : GetLangString("Confirmed")) : ""%>&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("Approver")%>：</strong></div>
                </td>
                <td>
                    <%=Order.ApproveID%>&nbsp;
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <th colspan="4">
                    <%=GetLangString("ReceiverInfo")%>&nbsp;
                </th>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("LinkManID")%>：</strong></div>
                </td>
                <td>
                    <%=Order.CntctCode%>&nbsp;
                </td>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("LMName")%>：</strong></div>
                </td>
                <td>
                    <%=Order.ContactPerson%>&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("Telephone")%>：</strong></div>
                </td>
                <td>
                    <%=Order.Telephone%>&nbsp;
                </td>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("Mobile")%>：</strong></div>
                </td>
                <td>
                    <%=Order.Mobile%>&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("Email")%>：</strong></div>
                </td>
                <td colspan="3">
                    <%=Order.Email%>&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("Address")%>：</strong></div>
                </td>
                <td colspan="3">
                    <%=Order.Address%>&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("Remark")%>：</strong></div>
                </td>
                <td colspan="3">
                    <%=Order.Remark%>&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("BillAddress")%>：</strong></div>
                </td>
                <td colspan="3">
                    <%=Order.BillAddress%>&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("ShipAddress")%>：</strong></div>
                </td>
                <td colspan="3">
                    <%=Order.ShipAddress%>&nbsp;
                </td>
            </tr>
            <tr>
                <th colspan="4">
                    <%=GetLangString("PaymentInfo")%>&nbsp;
                </th>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("Currency")%>：</strong></div>
                </td>
                <td>
                    <%=Order.Currency%>&nbsp;
                </td>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("TaxRate")%>：</strong></div>
                </td>
                <td>
                    <%=Order.Rate%>&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("TotalAmount")%>：</strong></div>
                </td>
                <td>
                    <%=Order.TotalAmount%>&nbsp;
                </td>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("BaseAmount")%>：</strong></div>
                </td>
                <td>
                    <%=Order.BaseAmount%>&nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>
                            <%=GetLangString("TaxAmount")%>：</strong></div>
                </td>
                <td>
                    <%=Order.TaxAmount%>&nbsp;
                </td>
                <td>
                    <div align="right">
                        <strong></strong>
                    </div>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                        <strong>SAP订单号：</strong></div>
                </td>
                <td>
                    <%=Order.SAPSoNo%>&nbsp;
                </td>
                <td>
                    <div align="right">
                        <strong>SAP合同号：</strong>
                    </div>
                </td>
                <td>
                    <%=Order.ContractId %>
                </td>
            </tr>
            <tr>
                <th colspan="4">
                    合同条款
                </th>
            </tr>
            <tr>
                <td colspan="4">
                    <FCKeditorV2:FCKeditor ID="fckContent" runat="server" AutoDetectLanguage="false"
                        Height="400">
                    </FCKeditorV2:FCKeditor>
                </td>
            </tr>
        </table>
    </div>
    <div class="list-div" style="margin-bottom: 5px">
        <table width="100%" cellpadding="3" cellspacing="1">
            <tr>
                <th colspan="7" scope="col">
                    <%=GetLangString("OrderItems")%>
                </th>
            </tr>
            <tr>
                <td>
                    <table width="99%" id="OrderItems" border="1px">
                        <asp:Repeater ID="repOrderItems" runat="server" OnItemDataBound="repOrderItems_ItemDataBound">
                            <HeaderTemplate>
                                <tr>
                                    <th>
                                        <%#GetLangString("OrderItemNo")%>
                                    </th>
                                    <th>
                                        <%#GetLangString("ItemCode")%>
                                    </th>
                                    <th>
                                        <%#GetLangString("ProductName")%>
                                    </th>
                                    <th>
                                        <%#GetLangString("ShopNumber")%>
                                    </th>
                                    <th>
                                        <%#GetLangString("SalesUnit")%>
                                    </th>
                                    <th>
                                        <%#GetLangString("Weight")%>
                                    </th>
                                    <th>
                                        <%#GetLangString("WeightUnit")%>
                                    </th>
                                    <th>
                                        <%#GetLangString("UnitPrice")%>
                                    </th>
                                    <th>
                                        <%#GetLangString("RowPrice")%>
                                    </th>
                                    <th>
                                        <%#GetLangString("TaxRate")%>
                                    </th>
                                    <th>
                                        <%#GetLangString("RowTotalPrice")%>
                                    </th>
                                    <th>
                                        需求日期
                                    </th>
                                </tr>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <asp:HiddenField ID="hfItemID" runat="server" Value='<%#Eval("OrderItemID")%>' />
                                        <%#Eval("ItemNo")%>
                                    </td>
                                    <td>
                                        <%#Eval("ItemCode") %>
                                    </td>
                                    <td>
                                        <%#(new TimKen.BussLogic.PDescriptionManager()).GetModel(int.Parse(Eval("ProductID").ToString()),LanguageID).Name %>
                                    </td>
                                    <td>
                                        <%#Eval("Quantity") %>
                                    </td>
                                    <td>
                                        <%#Eval("Unit") %>
                                    </td>
                                    <td>
                                        <%#Eval("Weight") %>
                                    </td>
                                    <td>
                                        <%#Eval("WeightUnit") %>
                                    </td>
                                    <td>
                                        <%#Eval("FinalPrice") %>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtBaseAmount" runat="server" Width="100px" Text=' <%#Eval("BaseAmount") %>'></asp:TextBox>
                                    </td>
                                    <td>
                                        <%#Eval("TaxAmount") %>
                                    </td>
                                    <td>
                                        <%#Eval("TotalAmount") %>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtRequestDate" runat="server" Width="100px" Text='<%#Eval("RequestDate","{0:d}")%>'
                                            onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',dateFmt:'yyyy-MM-dd'})"></asp:TextBox>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <div class="list-div" style="margin-bottom: 5px">
        <table cellpadding="3" cellspacing="1">
            <tr>
                <th colspan="6">
                    <%=GetLangString("Operation") %>
                </th>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" CssClass="button"
                        Text="保存" />
                    <asp:Button ID="btnExportExcel" runat="server" CssClass="button" Text="导出订单" OnClick="btnExportExcel_Click" />
                    <asp:FileUpload ID="fileExcel" runat="server" BorderStyle="None"  CssClass="button"
                        Width="150px" />
                    <asp:Button ID="bImportExcel" runat="server" CssClass="button" Text="导入订单" OnClick="bImportExcel_Click" />
                    <asp:Button ID="btnConfirm" runat="server" OnClick="btnConfirm_Click" CssClass="button" />
                    <asp:Button ID="btnCancel" runat="server" OnClick="btnCancel_Click" CssClass="button" />
                    <asp:Button ID="btnConfirmPayment" runat="server" OnClick="btnConfirmPayment_Click"
                        CssClass="button" />
                    <input type="button" onclick="Rek()" value="打印" class="button" />
                    <asp:Button ID="Button1" runat="server" CssClass="button" Text="导出" OnClick="Button1_Click"
                        OnClientClick="method1('OrderItems')" />
                    <asp:Button ID="btnConfirmContract" runat="server" Enabled="false" OnClick="btnConfirmContract_Click"
                        CssClass="button" />
                    <input type="button" onclick="history.go(-1)" value="返回" class="button" />
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
